From: Dan Winship Date: Tue, 5 Apr 2011 14:49:21 +0000 (-0400) Subject: StScrollBar: use clutter_actor_has_allocation() X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~8230 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=55771b437b3ae531fb31dfd6ca865e4c1d23d392;p=gnome-shell.git StScrollBar: use clutter_actor_has_allocation() StScrollBar was tracking whether or not it currently had a valid allocation, but since Clutter 1.4 there is a method it can call to get that information instead. https://bugzilla.gnome.org/show_bug.cgi?id=648758 --- diff --git a/src/st/st-scroll-bar.c b/src/st/st-scroll-bar.c index 3f67a27da..e6eb81f5b 100644 --- a/src/st/st-scroll-bar.c +++ b/src/st/st-scroll-bar.c @@ -75,14 +75,6 @@ struct _StScrollBarPrivate ClutterAnimation *paging_animation; guint vertical : 1; - - /* We want to keep track of whether we have a currently valid - * allocation or not. This isn't exported from ClutterActor - * so we need to shadow the computations and track it ourselves. - * - * http://bugzilla.openedhand.com/show_bug.cgi?id=2024 - */ - guint needs_allocation : 1; }; enum @@ -283,28 +275,6 @@ st_scroll_bar_unmap (ClutterActor *actor) clutter_actor_unmap (priv->handle); } -static void -st_scroll_bar_parent_set (ClutterActor *actor, - ClutterActor *old_parent) -{ - StScrollBarPrivate *priv = ST_SCROLL_BAR (actor)->priv; - - priv->needs_allocation = TRUE; - - if (CLUTTER_ACTOR_CLASS (st_scroll_bar_parent_class)->parent_set) - CLUTTER_ACTOR_CLASS (st_scroll_bar_parent_class)->parent_set (actor, old_parent); -} - -static void -st_scroll_bar_queue_relayout (ClutterActor *actor) -{ - StScrollBarPrivate *priv = ST_SCROLL_BAR (actor)->priv; - - priv->needs_allocation = TRUE; - - CLUTTER_ACTOR_CLASS (st_scroll_bar_parent_class)->queue_relayout (actor); -} - static void scroll_bar_allocate_children (StScrollBar *bar, const ClutterActorBox *box, @@ -581,9 +551,6 @@ st_scroll_bar_allocate (ClutterActor *actor, ClutterAllocationFlags flags) { StScrollBar *bar = ST_SCROLL_BAR (actor); - StScrollBarPrivate *priv = bar->priv; - - priv->needs_allocation = FALSE; /* Chain up */ CLUTTER_ACTOR_CLASS (st_scroll_bar_parent_class)->allocate (actor, box, flags); @@ -594,7 +561,6 @@ st_scroll_bar_allocate (ClutterActor *actor, static void scroll_bar_update_positions (StScrollBar *bar) { - StScrollBarPrivate *priv = bar->priv; ClutterActorBox box; /* Due to a change in the adjustments, we need to reposition our @@ -608,7 +574,7 @@ scroll_bar_update_positions (StScrollBar *bar) * allocate our children if we already have a valid allocation, and * otherwise just wait for the queued relayout. */ - if (priv->needs_allocation) + if (!clutter_actor_has_allocation (CLUTTER_ACTOR (bar))) return; clutter_actor_get_allocation_box (CLUTTER_ACTOR (bar), &box); @@ -718,8 +684,6 @@ st_scroll_bar_class_init (StScrollBarClass *klass) actor_class->get_preferred_width = st_scroll_bar_get_preferred_width; actor_class->get_preferred_height = st_scroll_bar_get_preferred_height; - actor_class->parent_set = st_scroll_bar_parent_set; - actor_class->queue_relayout = st_scroll_bar_queue_relayout; actor_class->allocate = st_scroll_bar_allocate; actor_class->paint = st_scroll_bar_paint; actor_class->pick = st_scroll_bar_pick; @@ -1235,8 +1199,6 @@ st_scroll_bar_init (StScrollBar *self) g_signal_connect (self, "notify::reactive", G_CALLBACK (st_scroll_bar_notify_reactive), NULL); - - self->priv->needs_allocation = TRUE; } StWidget *